package com.eliza.spring.cloud.eureka.consumer.service

import com.eliza.spring.cloud.library.mapper.UserMapper
import com.eliza.spring.cloud.library.pojo.User
import org.mybatis.spring.annotation.MapperScan
import org.springframework.stereotype.Service
import javax.annotation.Resource

@MapperScan(basePackages = ["com.eliza.spring.cloud.library.mapper"])
@Service
class UserService {
    @Resource
    private lateinit var userMapper: UserMapper

    /**
     * Query by id
     * 通过 id 查询
     * @param id
     * @return
     */
    fun queryByUserId(id: Long): User? {
        return userMapper.findById(id)
    }
}